<template>
  <div class="cart">
    <header>
      <div>购物车</div>
      <span>共4件</span>
      <p>管理</p>
    </header>
    <notice></notice>
    <CheckboxGroup class="cart_contant" v-model="checkedCities" @change="handleCheckedCitiesChange">
      <div class="cart_shop">
        <div class="cart_shop_header">
          <van-icon name="shop" size=".33rem"/>
          <span class="shop_name">展晔家具自营店</span>
          <van-icon name="arrow" size=".24rem"/>
        </div>
      </div>
      <div class="cart_item">
        <Checkbox class="_check"></Checkbox>
        <div class="item_detail">
          <div class="item_msg">
            <img :src="$img('logo.png')">
            <div class="msg_right">
              <p>威灵顿系列 美式古典 至尊之享 意大利进口全真皮沙发</p>
              <div><span>三合一沙发; 官方标配</span><van-icon name="arrow-down" size=".24rem"/></div>
            </div>
          </div>
          <div class="item_price">
            <span>￥ 1400</span>
            <van-stepper v-model="value" integer />
          </div>
        </div>
      </div>
    </CheckboxGroup>
  </div>
</template>

<script>
// import { CheckboxGroup } from 'element-ui'
import { Checkbox, CheckboxGroup } from 'element-ui'
const cityOptions = ['上海', '北京', '广州', '深圳']
export default {
  components: {
    Checkbox,
    CheckboxGroup
  },
  data () {
    return {
      checkedCities: [],
      checkAll: false,
      isIndeterminate: true,
      cities: cityOptions,
      value: 1
    }
  },
  methods: {
    handleCheckAllChange (val) {
      this.checkedCities = val ? cityOptions : []
      this.isIndeterminate = false
    },
    handleCheckedCitiesChange (value) {
      let checkedCount = value.length
      this.checkAll = checkedCount === this.cities.length
      this.isIndeterminate = checkedCount > 0 && checkedCount < this.cities.length
    }
  }
}
</script>

<style lang="scss">
.cart{
  height: 100%;
  background: #f6f6f6;
  header{
    padding: 0 .32rem .18rem;
    display: flex;
    background: #FF2A1F;
    color: #ffffff;
    height: .88rem;
    align-items: flex-end;
    box-sizing: border-box;
    div{
      font-size: .34rem;
      font-weight: bold;
      flex: 0 1 auto;
    }
    span{
      flex: 1;
      font-size: .24rem;
      margin-left: .16rem;
    }
    p{
      font-size: .28rem;
    }
  }
  .cart_contant{
    padding: .16rem;
    .cart_shop{
      background: #ffffff;
      padding: .32rem .16rem;
      .cart_shop_header{
        display: flex;
        align-items: center;
        .shop_name{
          color: #333333;
          font-size: .24rem;
          margin: 0 .16rem 0 .1rem;
          font-weight: bold;
        }
      }
    }
  }
  .cart_item{
    display: flex;
    font-size: .24rem;
    align-items: center;
    padding: .16rem .38rem .16rem .16rem;
    background: #ffffff;
    .item_detail{
      margin-left: .16rem;
      .item_msg{
        display: flex;
        margin-bottom: .1rem;
        img{
          width: 1.6rem;
          height: 1.6rem;
          border-radius: .16rem;
          margin-right: .24rem;
        }
        .msg_right{
          display: flex;
          flex-direction: column;
          justify-content: space-between;
          p{
            height: .68rem;
            display: -webkit-box;
            -webkit-box-orient: vertical;
            -webkit-line-clamp: 2;
            overflow: hidden;
          }
          div{
            max-width: 2.98rem;
            height: .48rem;
            border-radius: .24rem;
            background: #f0f0f0;
            color: #999999;
            line-height: .48rem;
            text-align: center;
            display: flex;
            padding: 0 .16rem;
            align-items: center;
            justify-content: center;
            span{
              margin-right: .1rem;
            }
          }
        }
      }
      .item_price{
        display: flex;
        justify-content: flex-end;
        align-items: center;
        span{
          margin-right: 1.7rem;
          color: #fe0000;
          font-size: .28rem;
          font-weight: 700;
        }
      }
    }
    ._check{
      width: .32rem;
      height: .32rem;
      border-radius: .32rem;
    }
  }
}
</style>
